// Copyright (c) 2017-2023 Cloudflare, Inc.
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
//     https://opensource.org/licenses/Apache-2.0
import * as assert from 'node:assert';
import {
  invocationPromises,
  spans,
  testTailHandler,
} from 'test:instumentation-tail';

// Use shared instrumentation test tail worker
export default testTailHandler;

export const test = {
  async test() {
    // Wait for all the tailStream executions to finish
    await Promise.allSettled(invocationPromises);

    // Recorded streaming tail worker events, in insertion order.
    let received = Array.from(spans.values());

    // spans emitted by r2-test.js in execution order
    let expected = [
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_uploadPart',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'UploadPart',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.part_number': 1n,
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'partEtag',
        closed: true,
      },
      {
        name: 'r2_abortMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'AbortMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.response.success': true,
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'basicKey',
        'cloudflare.r2.request.uploaded_parts': '1',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_list',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'ListObjects',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.limit': 1n,
        'cloudflare.r2.request.prefix': 'basic',
        'cloudflare.r2.request.cursor': 'ai',
        'cloudflare.r2.request.delimiter': '/',
        'cloudflare.r2.request.include.http_metadata': true,
        'cloudflare.r2.request.include.custom_metadata': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.returned_objects': 1n,
        'cloudflare.r2.response.delimited_prefixes': 0n,
        'cloudflare.r2.response.truncated': true,
        'cloudflare.r2.response.cursor': 'ai',
        closed: true,
      },
      {
        name: 'r2_delete',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'DeleteObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.keys': 'basicKey',
        'cloudflare.r2.response.success': true,
        closed: true,
      },
      {
        name: 'r2_delete',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'DeleteObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.keys': 'basicKey, basicKey2',
        'cloudflare.r2.response.success': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'rangeOffLen',
        'cloudflare.r2.request.range.offset': 1n,
        'cloudflare.r2.request.range.length': 3n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'throwOnInvalidEtag',
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'throwOnInvalidEtag',
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'rangeSuff',
        'cloudflare.r2.request.range.suffix': 2n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'onlyIfStrongEtag',
        'cloudflare.r2.request.only_if.etag_matches': 'strongEtag',
        'cloudflare.r2.request.only_if.etag_does_not_match': 'strongEtag',
        'cloudflare.r2.request.only_if.uploaded_before':
          '2000-01-01T00:00:00.000Z',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'onlyIfWildcard',
        'cloudflare.r2.request.only_if.etag_matches': '*',
        'cloudflare.r2.request.only_if.etag_does_not_match': '*',
        'cloudflare.r2.request.only_if.uploaded_after':
          '2000-01-01T00:00:00.000Z',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'onlyIfStrongEtag',
        'cloudflare.r2.request.only_if.etag_matches': 'strongEtag',
        'cloudflare.r2.request.only_if.etag_does_not_match': 'strongEtag',
        'cloudflare.r2.request.only_if.uploaded_before':
          '2000-01-01T00:00:00.000Z',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'onlyIfWildcard',
        'cloudflare.r2.request.only_if.etag_matches': '*',
        'cloudflare.r2.request.only_if.etag_does_not_match': '*',
        'cloudflare.r2.request.only_if.uploaded_after':
          '2000-01-01T00:00:00.000Z',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.request.http_metadata.content_type': 'text/plain',
        'cloudflare.r2.request.http_metadata.content_encoding': 'utf-8',
        'cloudflare.r2.request.http_metadata.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.request.http_metadata.content_language': 'en-US',
        'cloudflare.r2.request.http_metadata.cache_control': 'no-store',
        'cloudflare.r2.request.http_metadata.cache_expiry': 1000n,
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_list',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'ListObjects',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.prefix': 'httpMeta',
        'cloudflare.r2.request.include.http_metadata': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.returned_objects': 1n,
        'cloudflare.r2.response.delimited_prefixes': 0n,
        'cloudflare.r2.response.truncated': false,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.request.http_metadata.content_type': 'text/plain',
        'cloudflare.r2.request.http_metadata.content_encoding': 'utf-8',
        'cloudflare.r2.request.http_metadata.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.request.http_metadata.content_language': 'en-US',
        'cloudflare.r2.request.http_metadata.cache_control': 'no-store',
        'cloudflare.r2.request.http_metadata.cache_expiry': 1000n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.request.uploaded_parts': '',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.request.http_metadata.content_type': 'text/plain',
        'cloudflare.r2.request.http_metadata.content_encoding': 'utf-8',
        'cloudflare.r2.request.http_metadata.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.request.http_metadata.content_language': 'en-US',
        'cloudflare.r2.request.http_metadata.cache_control': 'no-store',
        'cloudflare.r2.request.http_metadata.cache_expiry': 1000n,
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_list',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'ListObjects',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.prefix': 'httpMeta',
        'cloudflare.r2.request.include.http_metadata': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.returned_objects': 1n,
        'cloudflare.r2.response.delimited_prefixes': 0n,
        'cloudflare.r2.response.truncated': false,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.request.http_metadata.content_type': 'text/plain',
        'cloudflare.r2.request.http_metadata.content_encoding': 'utf-8',
        'cloudflare.r2.request.http_metadata.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.request.http_metadata.content_language': 'en-US',
        'cloudflare.r2.request.http_metadata.cache_control': 'no-store',
        'cloudflare.r2.request.http_metadata.cache_expiry': 1000n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'httpMetadata',
        'cloudflare.r2.request.uploaded_parts': '',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.content_type': 'text/plain',
        'cloudflare.r2.response.content_encoding': 'utf-8',
        'cloudflare.r2.response.content_disposition':
          'attachment; filename = "basicKey.txt"',
        'cloudflare.r2.response.content_language': 'en-US',
        'cloudflare.r2.response.cache_control': 'no-store',
        'cloudflare.r2.response.cache_expiry': '1970-01-01T00:00:01.000Z',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'customMetadata',
        'cloudflare.r2.request.custom_metadata': true,
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'customMetadata',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'customMetadata',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_list',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'ListObjects',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.prefix': 'customMeta',
        'cloudflare.r2.request.include.custom_metadata': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.returned_objects': 1n,
        'cloudflare.r2.response.delimited_prefixes': 0n,
        'cloudflare.r2.response.truncated': false,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'customMetadata',
        'cloudflare.r2.request.custom_metadata': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'customMetadata',
        'cloudflare.r2.request.uploaded_parts': '',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classDefault',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classDefault',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classDefault',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classDefault',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'classDefault',
        'cloudflare.r2.request.uploaded_parts': '',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classStandard',
        'cloudflare.r2.request.storage_class': 'Standard',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classStandard',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classStandard',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classStandard',
        'cloudflare.r2.request.storage_class': 'Standard',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'classStandard',
        'cloudflare.r2.request.uploaded_parts': '',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classInfrequentAccess',
        'cloudflare.r2.request.storage_class': 'InfrequentAccess',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'InfrequentAccess',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classInfrequentAccess',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'InfrequentAccess',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classInfrequentAccess',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'InfrequentAccess',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'classInfrequentAccess',
        'cloudflare.r2.request.storage_class': 'InfrequentAccess',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'classInfrequentAccess',
        'cloudflare.r2.request.uploaded_parts': '',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'InfrequentAccess',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssec',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssec',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssec',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssecMultipart',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_uploadPart',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'UploadPart',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.part_number': 1n,
        'cloudflare.r2.request.key': 'ssecMultipart',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.request.size': 3n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'partEtag',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'ssecMultipart',
        'cloudflare.r2.request.uploaded_parts': '1',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssec',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_get',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'GetObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssec',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssec',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_createMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CreateMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'ssecMultipart',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.upload_id': 'multipartId',
        closed: true,
      },
      {
        name: 'r2_uploadPart',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'UploadPart',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.part_number': 1n,
        'cloudflare.r2.request.key': 'ssecMultipart',
        'cloudflare.r2.request.ssec_key': true,
        'cloudflare.r2.request.size': 3n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'partEtag',
        closed: true,
      },
      {
        name: 'r2_completeMultipartUpload',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'CompleteMultipartUpload',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.upload_id': 'multipartId',
        'cloudflare.r2.request.key': 'ssecMultipart',
        'cloudflare.r2.request.uploaded_parts': '1',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.ssec_key': true,
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_put',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'PutObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'multipleChecksums',
        'cloudflare.r2.request.checksum.type': 'md5',
        'cloudflare.r2.request.checksum.value':
          '9a0364b9e99bb480dd25e1f0284c8555',
        'cloudflare.r2.request.size': 7n,
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.checksum.md5':
          '9a0364b9e99bb480dd25e1f0284c8555',
        'cloudflare.r2.response.checksum.sha1':
          '2a0364b9e99bb480dd25e1f0284c855511223344',
        'cloudflare.r2.response.checksum.sha256':
          '3a0364b9e99bb480dd25e1f0284c8555112233445566778899aabbccddeeff00',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
      {
        name: 'r2_head',
        'cloudflare.binding.type': 'r2',
        'cloudflare.binding.name': 'BUCKET',
        'cloudflare.r2.operation': 'HeadObject',
        'cloudflare.r2.bucket': 'r2-test',
        'cloudflare.r2.request.key': 'multipleChecksums',
        'cloudflare.r2.response.success': true,
        'cloudflare.r2.response.etag': 'objectEtag',
        'cloudflare.r2.response.size': 123,
        'cloudflare.r2.response.uploaded': '2024-08-27T14:00:57.918Z',
        'cloudflare.r2.response.checksum.md5':
          '9a0364b9e99bb480dd25e1f0284c8555',
        'cloudflare.r2.response.checksum.sha1':
          '2a0364b9e99bb480dd25e1f0284c855511223344',
        'cloudflare.r2.response.checksum.sha256':
          '3a0364b9e99bb480dd25e1f0284c8555112233445566778899aabbccddeeff00',
        'cloudflare.r2.response.storage_class': 'Standard',
        'cloudflare.r2.response.custom_metadata': true,
        closed: true,
      },
    ];

    assert.deepStrictEqual(received, expected);
  },
};
